# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-funcparserlib
pkgver=1.0.1
pkgrel=2
pkgdesc="Recursive descent parsing library based on functional combinators"
url="https://funcparserlib.pirx.ru"
license=('MIT')
arch=('any')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-poetry-core')
checkdepends=('python-six')
source=("$pkgname-$pkgver.tar.gz::https://github.com/vlasovskikh/funcparserlib/archive/$pkgver.tar.gz")
sha512sums=('d64fe07337822077a0aab6d5049cd81f2ac56ccd9d1db2522c245cadf8cc8421ff1c7931f6a075d821a8634ac8aea51c7ae30fe763e679b70b35955a3f6aa8c7')

build() {
  cd funcparserlib-$pkgver
  python -m build -nw
}

check() {
  cd funcparserlib-$pkgver
  python -m unittest discover
}

package() {
  cd funcparserlib-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
